package com.demo.modules.log.controller;

import com.demo.common.core.domain.SysOperLogBo;
import com.demo.common.core.result.R;
import com.demo.common.core.utils.bean.BeanUtils;
import com.demo.common.datasource.web.controller.BaseController;
import com.demo.modules.log.domain.log.SysOperLog;
import com.demo.modules.log.service.ISysOperLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "B - 操作日志")
@RestController
@RequestMapping("/log")
public class SysOperLogController extends BaseController {

    @Autowired
    private ISysOperLogService iSysOperLogService;

    @ApiOperation("添加操作日志")
    @PostMapping("/operLocation")
    public R<Boolean> operLocation(SysOperLogBo sysLogininforBo) {
        return R.ok(iSysOperLogService.save(BeanUtils.copyDataProp(sysLogininforBo, new SysOperLog())));
    }
}
